{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np # 数据处理最重要的模块\n",
    "import pandas as pd # 数据处理最重要的模块\n",
    "import scipy.stats as stats # 统计模块\n",
    "import scipy\n",
    "# import pymysql  # 导入数据库模块\n",
    "\n",
    "from datetime import datetime # 时间模块\n",
    "import statsmodels.formula.api as smf  # OLS regression\n",
    "\n",
    "# import pyreadr # read RDS file\n",
    "\n",
    "from matplotlib import style\n",
    "import matplotlib.pyplot as plt  # 画图模块\n",
    "import matplotlib.dates as mdates\n",
    "\n",
    "from matplotlib.font_manager import FontProperties # 作图中文\n",
    "from pylab import mpl\n",
    "#mpl.rcParams['font.sans-serif'] = ['SimHei']\n",
    "#plt.rcParams['font.family'] = 'Times New Roman'\n",
    "\n",
    "#输出矢量图 渲染矢量图\n",
    "%matplotlib inline\n",
    "%config InlineBackend.figure_format = 'svg'\n",
    "\n",
    "from IPython.core.interactiveshell import InteractiveShell # jupyter运行输出的模块\n",
    "#显示每一个运行结果\n",
    "InteractiveShell.ast_node_interactivity = 'all'\n",
    "\n",
    "#设置行不限制数量\n",
    "#pd.set_option('display.max_rows',None)\n",
    "\n",
    "#设置列不限制数量\n",
    "pd.set_option('display.max_columns', None)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Day</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1990-12-19</th>\n",
       "      <td></td>\n",
       "      <td>96.050</td>\n",
       "      <td>99.980</td>\n",
       "      <td>95.790</td>\n",
       "      <td>99.980</td>\n",
       "      <td>126000.00</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-20</th>\n",
       "      <td>99.98</td>\n",
       "      <td>104.300</td>\n",
       "      <td>104.390</td>\n",
       "      <td>99.980</td>\n",
       "      <td>104.390</td>\n",
       "      <td>19700.00</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-21</th>\n",
       "      <td>104.39</td>\n",
       "      <td>109.070</td>\n",
       "      <td>109.130</td>\n",
       "      <td>103.730</td>\n",
       "      <td>109.130</td>\n",
       "      <td>2800.00</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-24</th>\n",
       "      <td>109.13</td>\n",
       "      <td>113.570</td>\n",
       "      <td>114.550</td>\n",
       "      <td>109.130</td>\n",
       "      <td>114.550</td>\n",
       "      <td>3200.00</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-25</th>\n",
       "      <td>114.55</td>\n",
       "      <td>120.090</td>\n",
       "      <td>120.250</td>\n",
       "      <td>114.550</td>\n",
       "      <td>120.250</td>\n",
       "      <td>1500.00</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-24</th>\n",
       "      <td>2748.918</td>\n",
       "      <td>2770.754</td>\n",
       "      <td>2863.152</td>\n",
       "      <td>2761.372</td>\n",
       "      <td>2863.126</td>\n",
       "      <td>4776195.45</td>\n",
       "      <td>4.427953e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-25</th>\n",
       "      <td>2863.126</td>\n",
       "      <td>2901.419</td>\n",
       "      <td>2952.451</td>\n",
       "      <td>2889.048</td>\n",
       "      <td>2896.306</td>\n",
       "      <td>5682598.16</td>\n",
       "      <td>5.166981e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-26</th>\n",
       "      <td>2896.306</td>\n",
       "      <td>2893.745</td>\n",
       "      <td>3000.953</td>\n",
       "      <td>2889.014</td>\n",
       "      <td>3000.953</td>\n",
       "      <td>5763192.61</td>\n",
       "      <td>5.246691e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-27</th>\n",
       "      <td>3000.953</td>\n",
       "      <td>3049.103</td>\n",
       "      <td>3087.529</td>\n",
       "      <td>3017.445</td>\n",
       "      <td>3087.529</td>\n",
       "      <td>4922871.63</td>\n",
       "      <td>4.806126e+07</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>3087.529</td>\n",
       "      <td>3194.722</td>\n",
       "      <td>3358.588</td>\n",
       "      <td>3153.697</td>\n",
       "      <td>3336.497</td>\n",
       "      <td>11023379.17</td>\n",
       "      <td>1.167773e+08</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8251 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Preclose      Open   Highest    Lowest     Close       Volume  \\\n",
       "Day                                                                         \n",
       "1990-12-19              96.050    99.980    95.790    99.980    126000.00   \n",
       "1990-12-20     99.98   104.300   104.390    99.980   104.390     19700.00   \n",
       "1990-12-21    104.39   109.070   109.130   103.730   109.130      2800.00   \n",
       "1990-12-24    109.13   113.570   114.550   109.130   114.550      3200.00   \n",
       "1990-12-25    114.55   120.090   120.250   114.550   120.250      1500.00   \n",
       "...              ...       ...       ...       ...       ...          ...   \n",
       "2024-09-24  2748.918  2770.754  2863.152  2761.372  2863.126   4776195.45   \n",
       "2024-09-25  2863.126  2901.419  2952.451  2889.048  2896.306   5682598.16   \n",
       "2024-09-26  2896.306  2893.745  3000.953  2889.014  3000.953   5763192.61   \n",
       "2024-09-27  3000.953  3049.103  3087.529  3017.445  3087.529   4922871.63   \n",
       "2024-09-30  3087.529  3194.722  3358.588  3153.697  3336.497  11023379.17   \n",
       "\n",
       "                   Money  \n",
       "Day                       \n",
       "1990-12-19  4.940000e+05  \n",
       "1990-12-20  8.400000e+04  \n",
       "1990-12-21  1.600000e+04  \n",
       "1990-12-24  3.100000e+04  \n",
       "1990-12-25  6.000000e+03  \n",
       "...                  ...  \n",
       "2024-09-24  4.427953e+07  \n",
       "2024-09-25  5.166981e+07  \n",
       "2024-09-26  5.246691e+07  \n",
       "2024-09-27  4.806126e+07  \n",
       "2024-09-30  1.167773e+08  \n",
       "\n",
       "[8251 rows x 7 columns]"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = pd.read_csv('D:/python-homework/python-homework/000001.csv')#导入数据\n",
    "data['Day'] = pd.to_datetime(data['Day'],format='%Y/%m/%d')#时间格式\n",
    "data.set_index('Day', inplace = True)#索引\n",
    "data.sort_values(by = ['Day'],axis=0, ascending=True)#排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "      <th>Raw_return</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Day</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1995-01-03</th>\n",
       "      <td>647.870</td>\n",
       "      <td>637.720</td>\n",
       "      <td>647.710</td>\n",
       "      <td>630.530</td>\n",
       "      <td>639.880</td>\n",
       "      <td>23451800.00</td>\n",
       "      <td>1.806930e+08</td>\n",
       "      <td>-0.012333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-04</th>\n",
       "      <td>639.880</td>\n",
       "      <td>641.900</td>\n",
       "      <td>655.510</td>\n",
       "      <td>638.860</td>\n",
       "      <td>653.810</td>\n",
       "      <td>42222000.00</td>\n",
       "      <td>3.069230e+08</td>\n",
       "      <td>0.021770</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-05</th>\n",
       "      <td>653.810</td>\n",
       "      <td>655.380</td>\n",
       "      <td>657.520</td>\n",
       "      <td>645.810</td>\n",
       "      <td>646.890</td>\n",
       "      <td>43012300.00</td>\n",
       "      <td>3.015330e+08</td>\n",
       "      <td>-0.010584</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-06</th>\n",
       "      <td>646.890</td>\n",
       "      <td>642.750</td>\n",
       "      <td>643.890</td>\n",
       "      <td>636.330</td>\n",
       "      <td>640.760</td>\n",
       "      <td>48748200.00</td>\n",
       "      <td>3.537580e+08</td>\n",
       "      <td>-0.009476</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-01-09</th>\n",
       "      <td>640.760</td>\n",
       "      <td>637.520</td>\n",
       "      <td>637.550</td>\n",
       "      <td>625.040</td>\n",
       "      <td>626.000</td>\n",
       "      <td>50985100.00</td>\n",
       "      <td>3.985190e+08</td>\n",
       "      <td>-0.023035</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-24</th>\n",
       "      <td>2748.918</td>\n",
       "      <td>2770.754</td>\n",
       "      <td>2863.152</td>\n",
       "      <td>2761.372</td>\n",
       "      <td>2863.126</td>\n",
       "      <td>4776195.45</td>\n",
       "      <td>4.427953e+07</td>\n",
       "      <td>0.041547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-25</th>\n",
       "      <td>2863.126</td>\n",
       "      <td>2901.419</td>\n",
       "      <td>2952.451</td>\n",
       "      <td>2889.048</td>\n",
       "      <td>2896.306</td>\n",
       "      <td>5682598.16</td>\n",
       "      <td>5.166981e+07</td>\n",
       "      <td>0.011589</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-26</th>\n",
       "      <td>2896.306</td>\n",
       "      <td>2893.745</td>\n",
       "      <td>3000.953</td>\n",
       "      <td>2889.014</td>\n",
       "      <td>3000.953</td>\n",
       "      <td>5763192.61</td>\n",
       "      <td>5.246691e+07</td>\n",
       "      <td>0.036131</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-27</th>\n",
       "      <td>3000.953</td>\n",
       "      <td>3049.103</td>\n",
       "      <td>3087.529</td>\n",
       "      <td>3017.445</td>\n",
       "      <td>3087.529</td>\n",
       "      <td>4922871.63</td>\n",
       "      <td>4.806126e+07</td>\n",
       "      <td>0.028850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>3087.529</td>\n",
       "      <td>3194.722</td>\n",
       "      <td>3358.588</td>\n",
       "      <td>3153.697</td>\n",
       "      <td>3336.497</td>\n",
       "      <td>11023379.17</td>\n",
       "      <td>1.167773e+08</td>\n",
       "      <td>0.080637</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7223 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Preclose      Open   Highest    Lowest     Close       Volume  \\\n",
       "Day                                                                         \n",
       "1995-01-03   647.870   637.720   647.710   630.530   639.880  23451800.00   \n",
       "1995-01-04   639.880   641.900   655.510   638.860   653.810  42222000.00   \n",
       "1995-01-05   653.810   655.380   657.520   645.810   646.890  43012300.00   \n",
       "1995-01-06   646.890   642.750   643.890   636.330   640.760  48748200.00   \n",
       "1995-01-09   640.760   637.520   637.550   625.040   626.000  50985100.00   \n",
       "...              ...       ...       ...       ...       ...          ...   \n",
       "2024-09-24  2748.918  2770.754  2863.152  2761.372  2863.126   4776195.45   \n",
       "2024-09-25  2863.126  2901.419  2952.451  2889.048  2896.306   5682598.16   \n",
       "2024-09-26  2896.306  2893.745  3000.953  2889.014  3000.953   5763192.61   \n",
       "2024-09-27  3000.953  3049.103  3087.529  3017.445  3087.529   4922871.63   \n",
       "2024-09-30  3087.529  3194.722  3358.588  3153.697  3336.497  11023379.17   \n",
       "\n",
       "                   Money  Raw_return  \n",
       "Day                                   \n",
       "1995-01-03  1.806930e+08   -0.012333  \n",
       "1995-01-04  3.069230e+08    0.021770  \n",
       "1995-01-05  3.015330e+08   -0.010584  \n",
       "1995-01-06  3.537580e+08   -0.009476  \n",
       "1995-01-09  3.985190e+08   -0.023035  \n",
       "...                  ...         ...  \n",
       "2024-09-24  4.427953e+07    0.041547  \n",
       "2024-09-25  5.166981e+07    0.011589  \n",
       "2024-09-26  5.246691e+07    0.036131  \n",
       "2024-09-27  4.806126e+07    0.028850  \n",
       "2024-09-30  1.167773e+08    0.080637  \n",
       "\n",
       "[7223 rows x 8 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_new = data['1995-01':'2024-09'].copy()\n",
    "data_new['Close'] = pd.to_numeric(data_new['Close'])\n",
    "data_new['Preclose'] = pd.to_numeric(data_new['Preclose'])\n",
    "# 计算000001上证指数日收益率 两种：\n",
    "data_new['Raw_return'] = data_new['Close'] / data_new['Preclose'] - 1\n",
    "data_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Raw_return</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1995-01-31</th>\n",
       "      <td>-0.131631</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-02-28</th>\n",
       "      <td>-0.023694</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-03-31</th>\n",
       "      <td>0.177803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-04-30</th>\n",
       "      <td>-0.103552</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-05-31</th>\n",
       "      <td>0.207922</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-05-31</th>\n",
       "      <td>-0.005801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-06-30</th>\n",
       "      <td>-0.038684</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>-0.009656</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-08-31</th>\n",
       "      <td>-0.032849</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>0.173908</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>357 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Raw_return\n",
       "month                 \n",
       "1995-01-31   -0.131631\n",
       "1995-02-28   -0.023694\n",
       "1995-03-31    0.177803\n",
       "1995-04-30   -0.103552\n",
       "1995-05-31    0.207922\n",
       "...                ...\n",
       "2024-05-31   -0.005801\n",
       "2024-06-30   -0.038684\n",
       "2024-07-31   -0.009656\n",
       "2024-08-31   -0.032849\n",
       "2024-09-30    0.173908\n",
       "\n",
       "[357 rows x 1 columns]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Month_data = data_new.resample('ME')['Raw_return'].apply(lambda x: (1+x).prod() - 1).to_frame()\n",
    "Month_data.reset_index(inplace = True)#除去索引\n",
    "Month_data.rename(columns = {'Day':'month'}, inplace = True)\n",
    "Month_data.set_index('month', inplace = True)\n",
    "Month_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cpi</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1987-01-31</th>\n",
       "      <td>5.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1987-02-28</th>\n",
       "      <td>5.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1987-03-31</th>\n",
       "      <td>5.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1987-04-30</th>\n",
       "      <td>6.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1987-05-31</th>\n",
       "      <td>7.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-05-31</th>\n",
       "      <td>0.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-06-30</th>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>0.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-08-31</th>\n",
       "      <td>0.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>453 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            cpi\n",
       "month          \n",
       "1987-01-31  5.1\n",
       "1987-02-28  5.4\n",
       "1987-03-31  5.8\n",
       "1987-04-30  6.7\n",
       "1987-05-31  7.6\n",
       "...         ...\n",
       "2024-05-31  0.3\n",
       "2024-06-30  0.2\n",
       "2024-07-31  0.5\n",
       "2024-08-31  0.6\n",
       "2024-09-30  0.4\n",
       "\n",
       "[453 rows x 1 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "inflation = pd.read_csv('D:/python-homework/python-homework/inflation.csv')\n",
    "inflation['month'] = pd.to_datetime(inflation['month'],format='%Y/%m/%d')#时间格式\n",
    "inflation.set_index('month',inplace=True)#索引\n",
    "inflation.sort_values(by=['month'],axis=0,ascending=True)#排序"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#  股票市场的风险"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>RV</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1995-01-31</th>\n",
       "      <td>0.005695</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-02-28</th>\n",
       "      <td>0.018086</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-03-31</th>\n",
       "      <td>0.013378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-04-30</th>\n",
       "      <td>0.008281</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-05-31</th>\n",
       "      <td>0.148387</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-05-31</th>\n",
       "      <td>0.000915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-06-30</th>\n",
       "      <td>0.000642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>0.001441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-08-31</th>\n",
       "      <td>0.000705</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>0.011045</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>357 rows × 1 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                  RV\n",
       "month               \n",
       "1995-01-31  0.005695\n",
       "1995-02-28  0.018086\n",
       "1995-03-31  0.013378\n",
       "1995-04-30  0.008281\n",
       "1995-05-31  0.148387\n",
       "...              ...\n",
       "2024-05-31  0.000915\n",
       "2024-06-30  0.000642\n",
       "2024-07-31  0.001441\n",
       "2024-08-31  0.000705\n",
       "2024-09-30  0.011045\n",
       "\n",
       "[357 rows x 1 columns]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "market_varince = data_new.resample('ME').apply(\n",
    "    {\n",
    "        'Raw_return': lambda x: sum(x**2)\n",
    "    }\n",
    ")\n",
    "market_varince.reset_index(inplace = True)\n",
    "market_varince.rename(columns = {'Day':'month','Raw_return':'RV'}, inplace = True)\n",
    "market_varince.set_index('month', inplace = True)\n",
    "market_varince"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Raw_return</th>\n",
       "      <th>cpi</th>\n",
       "      <th>RV</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1995-01-31</th>\n",
       "      <td>-0.131631</td>\n",
       "      <td>24.1</td>\n",
       "      <td>0.005695</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-02-28</th>\n",
       "      <td>-0.023694</td>\n",
       "      <td>22.4</td>\n",
       "      <td>0.018086</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-03-31</th>\n",
       "      <td>0.177803</td>\n",
       "      <td>21.3</td>\n",
       "      <td>0.013378</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-04-30</th>\n",
       "      <td>-0.103552</td>\n",
       "      <td>20.7</td>\n",
       "      <td>0.008281</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1995-05-31</th>\n",
       "      <td>0.207922</td>\n",
       "      <td>20.3</td>\n",
       "      <td>0.148387</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-05-31</th>\n",
       "      <td>-0.005801</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.000915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-06-30</th>\n",
       "      <td>-0.038684</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.000642</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>-0.009656</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.001441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-08-31</th>\n",
       "      <td>-0.032849</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.000705</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>0.173908</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.011045</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>357 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Raw_return   cpi        RV\n",
       "month                                 \n",
       "1995-01-31   -0.131631  24.1  0.005695\n",
       "1995-02-28   -0.023694  22.4  0.018086\n",
       "1995-03-31    0.177803  21.3  0.013378\n",
       "1995-04-30   -0.103552  20.7  0.008281\n",
       "1995-05-31    0.207922  20.3  0.148387\n",
       "...                ...   ...       ...\n",
       "2024-05-31   -0.005801   0.3  0.000915\n",
       "2024-06-30   -0.038684   0.2  0.000642\n",
       "2024-07-31   -0.009656   0.5  0.001441\n",
       "2024-08-31   -0.032849   0.6  0.000705\n",
       "2024-09-30    0.173908   0.4  0.011045\n",
       "\n",
       "[357 rows x 3 columns]"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg_data = pd.merge(Month_data, inflation, left_index=True, right_index=True, how='inner')\n",
    "reg_data = pd.merge(reg_data, market_varince, left_index=True, right_index=True, how='inner')#合并\n",
    "reg_data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#  风险图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"1197.310937pt\" height=\"327.605758pt\" viewBox=\"0 0 1197.310937 327.605758\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2024-11-14T22:38:05.896972</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.8.4, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 327.605758 \n",
       "L 1197.310937 327.605758 \n",
       "L 1197.310937 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 38.482813 287.955758 \n",
       "L 1154.482812 287.955758 \n",
       "L 1154.482812 10.755758 \n",
       "L 38.482813 10.755758 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"me790c5062c\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"44.727295\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 1999 -->\n",
       "      <g transform=\"translate(47.48667 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-39\" d=\"M 703 97 \n",
       "L 703 672 \n",
       "Q 941 559 1184 500 \n",
       "Q 1428 441 1663 441 \n",
       "Q 2288 441 2617 861 \n",
       "Q 2947 1281 2994 2138 \n",
       "Q 2813 1869 2534 1725 \n",
       "Q 2256 1581 1919 1581 \n",
       "Q 1219 1581 811 2004 \n",
       "Q 403 2428 403 3163 \n",
       "Q 403 3881 828 4315 \n",
       "Q 1253 4750 1959 4750 \n",
       "Q 2769 4750 3195 4129 \n",
       "Q 3622 3509 3622 2328 \n",
       "Q 3622 1225 3098 567 \n",
       "Q 2575 -91 1691 -91 \n",
       "Q 1453 -91 1209 -44 \n",
       "Q 966 3 703 97 \n",
       "z\n",
       "M 1959 2075 \n",
       "Q 2384 2075 2632 2365 \n",
       "Q 2881 2656 2881 3163 \n",
       "Q 2881 3666 2632 3958 \n",
       "Q 2384 4250 1959 4250 \n",
       "Q 1534 4250 1286 3958 \n",
       "Q 1038 3666 1038 3163 \n",
       "Q 1038 2656 1286 2365 \n",
       "Q 1534 2075 1959 2075 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"85.831645\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2000 -->\n",
       "      <g transform=\"translate(88.59102 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"127.04861\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2001 -->\n",
       "      <g transform=\"translate(129.807985 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"168.152961\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 2002 -->\n",
       "      <g transform=\"translate(170.912336 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"209.257311\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 2003 -->\n",
       "      <g transform=\"translate(212.016686 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"250.361661\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 2004 -->\n",
       "      <g transform=\"translate(253.121036 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"291.578626\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 2005 -->\n",
       "      <g transform=\"translate(294.338001 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"332.682976\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 2006 -->\n",
       "      <g transform=\"translate(335.442351 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-36\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"373.787326\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 2007 -->\n",
       "      <g transform=\"translate(376.546701 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-37\" d=\"M 525 4666 \n",
       "L 3525 4666 \n",
       "L 3525 4397 \n",
       "L 1831 0 \n",
       "L 1172 0 \n",
       "L 2766 4134 \n",
       "L 525 4134 \n",
       "L 525 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-37\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_10\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"414.891676\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2008 -->\n",
       "      <g transform=\"translate(417.651051 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-38\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_11\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"456.108641\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2009 -->\n",
       "      <g transform=\"translate(458.868016 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_12\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"497.212991\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 2010 -->\n",
       "      <g transform=\"translate(499.972366 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_13\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"538.317342\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 2011 -->\n",
       "      <g transform=\"translate(541.076717 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_14\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"579.421692\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 2012 -->\n",
       "      <g transform=\"translate(582.181067 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_15\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"620.638657\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 2013 -->\n",
       "      <g transform=\"translate(623.398032 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_16\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"661.743007\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 2014 -->\n",
       "      <g transform=\"translate(664.502382 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_17\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"702.847357\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_17\">\n",
       "      <!-- 2015 -->\n",
       "      <g transform=\"translate(705.606732 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_18\">\n",
       "     <g id=\"line2d_18\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"743.951707\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_18\">\n",
       "      <!-- 2016 -->\n",
       "      <g transform=\"translate(746.711082 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-36\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_19\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"785.168672\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_19\">\n",
       "      <!-- 2017 -->\n",
       "      <g transform=\"translate(787.928047 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-37\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_20\">\n",
       "     <g id=\"line2d_20\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"826.273022\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_20\">\n",
       "      <!-- 2018 -->\n",
       "      <g transform=\"translate(829.032397 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-38\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_21\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"867.377372\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_21\">\n",
       "      <!-- 2019 -->\n",
       "      <g transform=\"translate(870.136747 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-39\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_22\">\n",
       "     <g id=\"line2d_22\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"908.481723\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_22\">\n",
       "      <!-- 2020 -->\n",
       "      <g transform=\"translate(911.241098 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_23\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"949.698688\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_23\">\n",
       "      <!-- 2021 -->\n",
       "      <g transform=\"translate(952.458063 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_24\">\n",
       "     <g id=\"line2d_24\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"990.803038\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_24\">\n",
       "      <!-- 2022 -->\n",
       "      <g transform=\"translate(993.562413 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_25\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"1031.907388\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_25\">\n",
       "      <!-- 2023 -->\n",
       "      <g transform=\"translate(1034.666763 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_26\">\n",
       "     <g id=\"line2d_26\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"1073.011738\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_26\">\n",
       "      <!-- 2024 -->\n",
       "      <g transform=\"translate(1075.771113 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_27\">\n",
       "     <g id=\"line2d_27\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#me790c5062c\" x=\"1114.228703\" y=\"287.955758\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_27\">\n",
       "      <!-- 2025 -->\n",
       "      <g transform=\"translate(1116.988078 320.405758) rotate(-90) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_28\">\n",
       "      <defs>\n",
       "       <path id=\"m84270858d5\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"252.944845\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_28\">\n",
       "      <!-- −0.2 -->\n",
       "      <g transform=\"translate(7.2 256.744064) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-2212\" d=\"M 678 2272 \n",
       "L 4684 2272 \n",
       "L 4684 1741 \n",
       "L 678 1741 \n",
       "L 678 2272 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-2e\" d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-2212\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"83.789062\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"147.412109\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"179.199219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_29\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"204.55572\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_29\">\n",
       "      <!-- −0.1 -->\n",
       "      <g transform=\"translate(7.2 208.354938) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-2212\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"83.789062\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"147.412109\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"179.199219\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_30\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"156.166594\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_30\">\n",
       "      <!-- 0.0 -->\n",
       "      <g transform=\"translate(15.579688 159.965813) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_31\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"107.777469\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_31\">\n",
       "      <!-- 0.1 -->\n",
       "      <g transform=\"translate(15.579688 111.576688) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_32\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"59.388344\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_32\">\n",
       "      <!-- 0.2 -->\n",
       "      <g transform=\"translate(15.579688 63.187563) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_33\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m84270858d5\" x=\"38.482813\" y=\"10.999219\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_33\">\n",
       "      <!-- 0.3 -->\n",
       "      <g transform=\"translate(15.579688 14.798437) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_34\">\n",
       "    <path d=\"M 89.210085 96.530887 \n",
       "L 92.47591 99.556046 \n",
       "L 95.966965 131.99715 \n",
       "L 99.345404 146.463073 \n",
       "L 102.836459 140.822326 \n",
       "L 106.214899 147.59496 \n",
       "L 109.705953 132.21685 \n",
       "L 113.197007 156.726161 \n",
       "L 116.575447 182.750448 \n",
       "L 120.066502 143.214088 \n",
       "L 123.444941 129.195065 \n",
       "L 126.935996 155.49589 \n",
       "L 130.42705 158.003229 \n",
       "L 133.580261 181.098961 \n",
       "L 137.071315 118.229449 \n",
       "L 140.449755 154.700799 \n",
       "L 143.940809 134.456131 \n",
       "L 147.319249 155.342721 \n",
       "L 150.810303 221.11579 \n",
       "L 154.301358 177.882636 \n",
       "L 157.679797 174.441724 \n",
       "L 161.170852 176.921986 \n",
       "L 164.549291 139.316613 \n",
       "L 168.040346 184.40851 \n",
       "L 171.5314 201.531491 \n",
       "L 174.684611 145.44849 \n",
       "L 178.175665 131.031035 \n",
       "L 181.554105 136.903264 \n",
       "L 185.045159 200.274613 \n",
       "L 188.423599 86.880562 \n",
       "L 191.914653 178.834161 \n",
       "L 195.405708 151.763028 \n",
       "L 198.784148 180.845739 \n",
       "L 202.275202 178.843356 \n",
       "L 205.653642 179.701524 \n",
       "L 209.144696 181.987759 \n",
       "L 212.63575 105.49461 \n",
       "L 215.788961 152.25951 \n",
       "L 219.280015 156.59866 \n",
       "L 222.658455 152.687759 \n",
       "L 226.149509 138.731192 \n",
       "L 229.527949 183.869097 \n",
       "L 233.019004 159.188432 \n",
       "L 236.510058 174.110095 \n",
       "L 239.888498 174.821511 \n",
       "L 243.379552 162.841884 \n",
       "L 246.757992 138.609701 \n",
       "L 250.249046 121.596502 \n",
       "L 253.740101 125.882987 \n",
       "L 257.005926 130.510834 \n",
       "L 260.49698 136.941748 \n",
       "L 263.87542 196.739532 \n",
       "L 267.366474 168.200265 \n",
       "L 270.744914 204.916171 \n",
       "L 274.235968 160.648734 \n",
       "L 277.727023 171.574876 \n",
       "L 281.105463 136.465673 \n",
       "L 284.596517 182.552474 \n",
       "L 287.974957 148.753627 \n",
       "L 291.466011 182.971045 \n",
       "L 294.957066 184.699558 \n",
       "L 298.110276 109.808333 \n",
       "L 301.60133 202.391918 \n",
       "L 304.97977 165.215693 \n",
       "L 308.470824 197.248196 \n",
       "L 311.849264 146.951704 \n",
       "L 315.340319 155.23099 \n",
       "L 318.831373 120.525841 \n",
       "L 322.209813 159.158664 \n",
       "L 325.700867 182.458797 \n",
       "L 329.079307 153.315018 \n",
       "L 332.570361 128.962403 \n",
       "L 336.061416 115.744383 \n",
       "L 339.214626 140.404213 \n",
       "L 342.705681 156.438521 \n",
       "L 346.08412 103.271388 \n",
       "L 349.575175 88.606879 \n",
       "L 352.953614 147.053648 \n",
       "L 356.444669 173.378459 \n",
       "L 359.935723 142.391538 \n",
       "L 363.314163 128.807239 \n",
       "L 366.805217 132.538369 \n",
       "L 370.183657 87.373628 \n",
       "L 373.674712 23.355758 \n",
       "L 377.165766 136.114408 \n",
       "L 380.318976 139.715257 \n",
       "L 383.810031 105.291225 \n",
       "L 387.18847 56.27373 \n",
       "L 390.679525 122.358314 \n",
       "L 394.057965 190.189048 \n",
       "L 397.549019 73.802368 \n",
       "L 401.040073 75.234675 \n",
       "L 404.418513 125.246184 \n",
       "L 407.909568 121.090732 \n",
       "L 411.288007 244.17157 \n",
       "L 414.779062 117.45156 \n",
       "L 418.270116 236.929482 \n",
       "L 421.535941 160.013756 \n",
       "L 425.026996 253.626081 \n",
       "L 428.405435 125.455815 \n",
       "L 435.274929 254.435974 \n",
       "L 438.765984 149.159624 \n",
       "L 442.257038 222.124348 \n",
       "L 445.635478 177.075463 \n",
       "L 449.126532 275.355758 \n",
       "L 452.504972 116.31699 \n",
       "L 455.996027 169.187354 \n",
       "L 459.487081 111.027931 \n",
       "L 462.640291 133.756974 \n",
       "L 466.131346 88.709666 \n",
       "L 469.509786 134.887866 \n",
       "L 473.00084 125.823417 \n",
       "L 476.37928 96.173879 \n",
       "L 479.870334 82.144654 \n",
       "L 483.361388 261.724509 \n",
       "L 486.739828 135.907568 \n",
       "L 490.230883 118.488457 \n",
       "L 493.609322 123.951327 \n",
       "L 497.100377 143.772872 \n",
       "L 500.591431 198.669538 \n",
       "L 503.744642 146.025127 \n",
       "L 507.235696 147.102175 \n",
       "L 510.614136 193.285919 \n",
       "L 514.10519 203.105871 \n",
       "L 517.48363 192.340599 \n",
       "L 520.974684 107.920112 \n",
       "L 524.465739 155.928089 \n",
       "L 527.844178 153.074884 \n",
       "L 531.335233 97.279548 \n",
       "L 534.713673 181.939777 \n",
       "L 538.204727 158.242733 \n",
       "L 541.695781 159.163257 \n",
       "L 544.848992 136.33716 \n",
       "L 548.340046 152.325513 \n",
       "L 551.718486 158.909864 \n",
       "L 555.20954 184.094744 \n",
       "L 558.58798 152.884176 \n",
       "L 565.570089 180.236411 \n",
       "L 568.948529 195.392972 \n",
       "L 572.439583 133.803838 \n",
       "L 575.818023 182.601476 \n",
       "L 579.309077 183.952791 \n",
       "L 582.800132 135.663996 \n",
       "L 586.065957 127.486992 \n",
       "L 589.557011 189.183317 \n",
       "L 592.935451 127.611581 \n",
       "L 596.426505 161.031112 \n",
       "L 599.804945 186.111092 \n",
       "L 603.295999 182.650445 \n",
       "L 606.787054 169.073398 \n",
       "L 610.165493 147.032424 \n",
       "L 613.656548 160.177044 \n",
       "L 617.034988 176.92671 \n",
       "L 620.526042 85.539859 \n",
       "L 624.017096 131.367789 \n",
       "L 627.170307 160.189183 \n",
       "L 630.661361 182.547943 \n",
       "L 634.039801 168.868464 \n",
       "L 637.530855 128.909371 \n",
       "L 640.909295 223.763589 \n",
       "L 644.40035 152.599528 \n",
       "L 647.891404 130.785239 \n",
       "L 651.269844 138.576251 \n",
       "L 654.760898 163.520666 \n",
       "L 658.139338 138.341603 \n",
       "L 661.630392 178.943588 \n",
       "L 665.121447 175.124517 \n",
       "L 668.274657 150.640026 \n",
       "L 671.765711 161.576632 \n",
       "L 675.144151 157.82057 \n",
       "L 678.635206 153.098037 \n",
       "L 682.013645 154.002478 \n",
       "L 685.5047 119.968005 \n",
       "L 688.995754 152.729005 \n",
       "L 692.374194 124.156704 \n",
       "L 695.865248 144.639769 \n",
       "L 699.243688 103.650304 \n",
       "L 702.734742 56.633805 \n",
       "L 706.225797 159.80474 \n",
       "L 709.379007 141.102835 \n",
       "L 712.870062 92.199337 \n",
       "L 716.248501 66.596554 \n",
       "L 719.739556 137.636304 \n",
       "L 723.117995 191.266427 \n",
       "L 726.60905 225.57206 \n",
       "L 730.100104 216.623119 \n",
       "L 733.478544 179.291114 \n",
       "L 736.969598 103.893697 \n",
       "L 740.348038 147.177034 \n",
       "L 743.839093 142.995607 \n",
       "L 747.330147 265.76191 \n",
       "L 750.595972 164.9373 \n",
       "L 754.087026 99.290947 \n",
       "L 757.465466 166.733875 \n",
       "L 760.956521 159.740215 \n",
       "L 767.826015 147.952562 \n",
       "L 771.317069 138.92618 \n",
       "L 774.695509 168.836729 \n",
       "L 778.186563 140.740115 \n",
       "L 781.565003 132.827994 \n",
       "L 785.056057 177.962344 \n",
       "L 788.547112 147.508863 \n",
       "L 791.700322 143.520848 \n",
       "L 795.191377 159.035553 \n",
       "L 798.569816 166.354933 \n",
       "L 802.060871 161.915627 \n",
       "L 805.439311 144.485262 \n",
       "L 808.930365 143.949683 \n",
       "L 812.421419 143.189025 \n",
       "L 815.799859 157.875643 \n",
       "L 819.290913 149.7512 \n",
       "L 822.669353 167.025606 \n",
       "L 826.160408 157.62825 \n",
       "L 829.651462 130.757391 \n",
       "L 832.804672 186.947529 \n",
       "L 836.295727 169.603688 \n",
       "L 839.674167 169.40111 \n",
       "L 843.165221 154.087995 \n",
       "L 846.543661 194.942362 \n",
       "L 850.034715 151.241726 \n",
       "L 853.52577 181.594269 \n",
       "L 856.904209 139.103224 \n",
       "L 860.395264 193.653652 \n",
       "L 863.773703 158.879069 \n",
       "L 867.264758 173.795171 \n",
       "L 870.755812 138.5739 \n",
       "L 873.909023 89.44402 \n",
       "L 877.400077 131.517502 \n",
       "L 880.778517 158.111077 \n",
       "L 884.269571 184.404614 \n",
       "L 887.648011 142.781836 \n",
       "L 891.139065 163.698968 \n",
       "L 894.63012 163.801572 \n",
       "L 898.008559 152.989541 \n",
       "L 901.499614 152.190784 \n",
       "L 904.878054 165.596416 \n",
       "L 908.369108 126.152323 \n",
       "L 911.860162 167.8414 \n",
       "L 915.125988 171.810601 \n",
       "L 918.617042 178.006633 \n",
       "L 921.995482 136.851763 \n",
       "L 925.486536 157.474418 \n",
       "L 928.864976 133.718967 \n",
       "L 932.35603 103.420669 \n",
       "L 939.225524 181.479228 \n",
       "L 942.716579 155.192211 \n",
       "L 946.095018 131.071113 \n",
       "L 949.586073 144.566364 \n",
       "L 953.077127 154.773328 \n",
       "L 956.230338 152.553112 \n",
       "L 959.721392 165.429129 \n",
       "L 963.099832 155.470684 \n",
       "L 966.590886 132.494689 \n",
       "L 969.969326 159.416199 \n",
       "L 973.46038 182.285296 \n",
       "L 976.951435 135.288978 \n",
       "L 980.329875 152.858219 \n",
       "L 983.820929 158.991419 \n",
       "L 987.199369 153.909015 \n",
       "L 990.690423 145.862543 \n",
       "L 994.181477 193.170559 \n",
       "L 997.334688 141.645999 \n",
       "L 1000.825742 185.531496 \n",
       "L 1004.204182 186.689149 \n",
       "L 1007.695236 134.033809 \n",
       "L 1011.073676 123.943422 \n",
       "L 1014.564731 176.86528 \n",
       "L 1018.055785 163.76734 \n",
       "L 1021.434225 183.026889 \n",
       "L 1024.925279 177.111324 \n",
       "L 1028.303719 113.04468 \n",
       "L 1031.794773 165.698652 \n",
       "L 1035.285828 130.100473 \n",
       "L 1038.439038 152.608964 \n",
       "L 1041.930092 157.161804 \n",
       "L 1045.308532 148.712843 \n",
       "L 1048.799587 173.451602 \n",
       "L 1052.178026 156.544413 \n",
       "L 1055.669081 142.720437 \n",
       "L 1059.160135 181.333252 \n",
       "L 1062.538575 157.6247 \n",
       "L 1066.029629 170.432936 \n",
       "L 1069.408069 154.419052 \n",
       "L 1072.899123 164.909186 \n",
       "L 1076.390178 186.483509 \n",
       "L 1079.656003 116.841154 \n",
       "L 1083.147057 151.994662 \n",
       "L 1086.525497 146.0378 \n",
       "L 1090.016551 158.97365 \n",
       "L 1093.394991 174.885492 \n",
       "L 1096.886046 160.839091 \n",
       "L 1100.3771 172.061992 \n",
       "L 1103.75554 72.014163 \n",
       "L 1103.75554 72.014163 \n",
       "\" clip-path=\"url(#pb277b339e0)\" style=\"fill: none; stroke: #ff0000; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 38.482813 287.955758 \n",
       "L 38.482813 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 1154.482812 287.955758 \n",
       "L 1154.482812 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 38.482812 287.955758 \n",
       "L 1154.482812 287.955758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 38.482812 10.755758 \n",
       "L 1154.482812 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "  </g>\n",
       "  <g id=\"axes_2\">\n",
       "   <g id=\"matplotlib.axis_3\">\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_35\">\n",
       "      <defs>\n",
       "       <path id=\"mc87c66d7d2\" d=\"M 0 0 \n",
       "L 3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"276.664775\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_34\">\n",
       "      <!-- 0.000 -->\n",
       "      <g transform=\"translate(1161.482812 280.463994) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_36\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"235.287946\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_35\">\n",
       "      <!-- 0.005 -->\n",
       "      <g transform=\"translate(1161.482812 239.087165) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_37\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"193.911116\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_36\">\n",
       "      <!-- 0.010 -->\n",
       "      <g transform=\"translate(1161.482812 197.710335) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_10\">\n",
       "     <g id=\"line2d_38\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"152.534287\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_37\">\n",
       "      <!-- 0.015 -->\n",
       "      <g transform=\"translate(1161.482812 156.333506) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_11\">\n",
       "     <g id=\"line2d_39\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"111.157458\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_38\">\n",
       "      <!-- 0.020 -->\n",
       "      <g transform=\"translate(1161.482812 114.956676) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_12\">\n",
       "     <g id=\"line2d_40\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"69.780628\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_39\">\n",
       "      <!-- 0.025 -->\n",
       "      <g transform=\"translate(1161.482812 73.579847) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_13\">\n",
       "     <g id=\"line2d_41\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mc87c66d7d2\" x=\"1154.482812\" y=\"28.403799\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_40\">\n",
       "      <!-- 0.030 -->\n",
       "      <g transform=\"translate(1161.482812 32.203018) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"159.033203\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"222.65625\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_42\">\n",
       "    <path d=\"M 89.210085 208.323676 \n",
       "L 92.47591 164.554453 \n",
       "L 99.345404 256.029311 \n",
       "L 102.836459 247.57449 \n",
       "L 106.214899 265.276233 \n",
       "L 109.705953 268.878546 \n",
       "L 113.197007 262.932273 \n",
       "L 116.575447 252.482952 \n",
       "L 120.066502 268.859635 \n",
       "L 123.444941 261.337248 \n",
       "L 126.935996 270.852879 \n",
       "L 130.42705 259.857179 \n",
       "L 133.580261 253.015118 \n",
       "L 137.071315 265.903092 \n",
       "L 140.449755 266.157326 \n",
       "L 143.940809 271.430325 \n",
       "L 147.319249 266.365761 \n",
       "L 150.810303 240.541872 \n",
       "L 154.301358 231.648867 \n",
       "L 157.679797 248.961733 \n",
       "L 161.170852 132.199597 \n",
       "L 164.549291 245.055523 \n",
       "L 168.040346 256.656339 \n",
       "L 171.5314 116.651413 \n",
       "L 174.684611 263.70345 \n",
       "L 178.175665 228.385859 \n",
       "L 181.554105 255.116741 \n",
       "L 185.045159 247.098859 \n",
       "L 188.423599 169.197721 \n",
       "L 191.914653 265.928573 \n",
       "L 195.405708 269.184693 \n",
       "L 198.784148 268.938706 \n",
       "L 202.275202 264.691471 \n",
       "L 205.653642 240.710316 \n",
       "L 209.144696 257.830561 \n",
       "L 212.63575 219.780758 \n",
       "L 215.788961 264.919614 \n",
       "L 219.280015 260.644894 \n",
       "L 222.658455 237.879746 \n",
       "L 226.149509 254.571466 \n",
       "L 229.527949 265.036234 \n",
       "L 233.019004 265.543129 \n",
       "L 236.510058 270.822368 \n",
       "L 239.888498 265.244423 \n",
       "L 243.379552 260.380402 \n",
       "L 246.757992 241.96314 \n",
       "L 250.249046 253.454311 \n",
       "L 253.740101 246.89398 \n",
       "L 257.005926 248.421494 \n",
       "L 260.49698 254.074863 \n",
       "L 263.87542 258.951548 \n",
       "L 267.366474 252.629565 \n",
       "L 270.744914 244.593463 \n",
       "L 274.235968 245.289452 \n",
       "L 277.727023 256.749943 \n",
       "L 281.105463 205.108833 \n",
       "L 284.596517 247.450675 \n",
       "L 287.974957 252.396258 \n",
       "L 291.466011 260.623566 \n",
       "L 294.957066 251.700563 \n",
       "L 298.110276 239.841482 \n",
       "L 301.60133 253.761829 \n",
       "L 304.97977 235.928523 \n",
       "L 308.470824 258.920191 \n",
       "L 311.849264 181.681739 \n",
       "L 315.340319 239.976571 \n",
       "L 318.831373 240.761889 \n",
       "L 322.209813 248.891595 \n",
       "L 325.700867 260.217958 \n",
       "L 329.079307 261.978474 \n",
       "L 332.570361 267.639192 \n",
       "L 336.061416 261.648507 \n",
       "L 339.214626 260.688755 \n",
       "L 342.705681 263.167542 \n",
       "L 346.08412 254.021726 \n",
       "L 349.575175 201.801125 \n",
       "L 352.953614 227.084683 \n",
       "L 356.444669 232.775603 \n",
       "L 359.935723 253.64778 \n",
       "L 363.314163 265.59331 \n",
       "L 366.805217 260.861034 \n",
       "L 370.183657 251.703224 \n",
       "L 373.674712 199.089926 \n",
       "L 377.165766 160.202364 \n",
       "L 380.318976 152.159002 \n",
       "L 383.810031 240.88979 \n",
       "L 387.18847 212.847237 \n",
       "L 390.679525 202.642456 \n",
       "L 394.057965 130.155156 \n",
       "L 397.549019 179.684845 \n",
       "L 401.040073 200.669852 \n",
       "L 404.418513 228.008154 \n",
       "L 407.909568 207.95694 \n",
       "L 411.288007 171.322986 \n",
       "L 414.779062 235.451454 \n",
       "L 418.270116 142.247821 \n",
       "L 421.535941 170.425236 \n",
       "L 425.026996 145.079902 \n",
       "L 428.405435 51.006364 \n",
       "L 431.89649 202.145202 \n",
       "L 435.274929 95.824678 \n",
       "L 438.765984 182.536586 \n",
       "L 442.257038 134.730931 \n",
       "L 445.635478 79.742363 \n",
       "L 449.126532 128.250609 \n",
       "L 452.504972 107.368384 \n",
       "L 455.996027 196.207066 \n",
       "L 459.487081 233.518202 \n",
       "L 462.640291 167.556647 \n",
       "L 466.131346 201.701631 \n",
       "L 469.509786 225.364976 \n",
       "L 473.00084 251.263131 \n",
       "L 476.37928 248.815454 \n",
       "L 479.870334 214.197331 \n",
       "L 483.361388 118.697571 \n",
       "L 486.739828 219.832646 \n",
       "L 490.230883 233.467365 \n",
       "L 493.609322 223.346225 \n",
       "L 497.100377 241.930487 \n",
       "L 500.591431 243.360447 \n",
       "L 503.744642 261.221315 \n",
       "L 507.235696 255.672731 \n",
       "L 510.614136 244.037638 \n",
       "L 514.10519 207.176201 \n",
       "L 517.48363 239.029932 \n",
       "L 520.974684 247.449118 \n",
       "L 524.465739 247.951042 \n",
       "L 527.844178 261.566691 \n",
       "L 531.335233 242.826053 \n",
       "L 534.713673 215.535092 \n",
       "L 538.204727 250.795571 \n",
       "L 541.695781 245.406028 \n",
       "L 544.848992 259.389422 \n",
       "L 548.340046 262.389363 \n",
       "L 551.718486 264.259865 \n",
       "L 555.20954 257.836119 \n",
       "L 558.58798 258.155915 \n",
       "L 562.079034 259.02661 \n",
       "L 565.570089 241.948914 \n",
       "L 568.948529 247.84845 \n",
       "L 572.439583 250.816965 \n",
       "L 575.818023 248.625304 \n",
       "L 579.309077 253.825752 \n",
       "L 582.800132 236.824962 \n",
       "L 586.065957 260.413519 \n",
       "L 589.557011 252.591512 \n",
       "L 592.935451 263.816045 \n",
       "L 596.426505 262.024019 \n",
       "L 599.804945 259.438554 \n",
       "L 603.295999 263.268998 \n",
       "L 606.787054 265.117044 \n",
       "L 610.165493 245.891265 \n",
       "L 613.656548 267.578236 \n",
       "L 617.034988 262.809433 \n",
       "L 620.526042 239.004474 \n",
       "L 624.017096 255.440683 \n",
       "L 627.170307 257.464592 \n",
       "L 630.661361 240.943473 \n",
       "L 634.039801 261.568589 \n",
       "L 637.530855 265.293821 \n",
       "L 640.909295 233.258414 \n",
       "L 644.40035 243.933191 \n",
       "L 647.891404 262.447153 \n",
       "L 651.269844 254.254505 \n",
       "L 654.760898 260.414721 \n",
       "L 658.139338 260.079018 \n",
       "L 661.630392 261.339501 \n",
       "L 665.121447 263.182201 \n",
       "L 668.274657 261.799575 \n",
       "L 671.765711 257.014238 \n",
       "L 678.635206 268.524219 \n",
       "L 682.013645 269.455902 \n",
       "L 685.5047 265.165453 \n",
       "L 688.995754 266.515067 \n",
       "L 692.374194 263.391538 \n",
       "L 695.865248 265.20732 \n",
       "L 699.243688 258.515186 \n",
       "L 702.734742 173.88957 \n",
       "L 706.225797 169.405255 \n",
       "L 709.379007 252.950287 \n",
       "L 712.870062 243.7509 \n",
       "L 716.248501 228.966303 \n",
       "L 719.739556 171.306352 \n",
       "L 723.117995 89.294359 \n",
       "L 726.60905 29.08796 \n",
       "L 730.100104 23.355758 \n",
       "L 733.478544 203.347639 \n",
       "L 736.969598 237.086285 \n",
       "L 740.348038 220.17342 \n",
       "L 743.839093 246.414298 \n",
       "L 747.330147 77.819581 \n",
       "L 750.595972 209.914685 \n",
       "L 754.087026 232.311082 \n",
       "L 757.465466 261.28336 \n",
       "L 760.956521 248.194397 \n",
       "L 764.33496 260.367873 \n",
       "L 767.826015 264.296393 \n",
       "L 771.317069 266.04909 \n",
       "L 778.186563 270.995688 \n",
       "L 781.565003 269.678545 \n",
       "L 785.056057 265.581277 \n",
       "L 788.547112 273.125581 \n",
       "L 791.700322 272.375353 \n",
       "L 795.191377 271.826481 \n",
       "L 798.569816 270.091785 \n",
       "L 802.060871 271.447079 \n",
       "L 805.439311 271.969374 \n",
       "L 808.930365 271.501538 \n",
       "L 812.421419 268.293067 \n",
       "L 815.799859 275.355758 \n",
       "L 819.290913 274.997933 \n",
       "L 822.669353 268.46602 \n",
       "L 826.160408 270.180103 \n",
       "L 829.651462 269.602795 \n",
       "L 832.804672 239.172593 \n",
       "L 836.295727 259.404693 \n",
       "L 839.674167 260.979723 \n",
       "L 843.165221 260.944702 \n",
       "L 846.543661 251.605224 \n",
       "L 850.034715 249.785518 \n",
       "L 853.52577 245.334227 \n",
       "L 856.904209 258.372063 \n",
       "L 860.395264 202.038884 \n",
       "L 863.773703 251.620774 \n",
       "L 867.264758 260.915133 \n",
       "L 870.755812 264.618553 \n",
       "L 873.909023 233.262387 \n",
       "L 877.400077 227.064986 \n",
       "L 880.778517 252.217892 \n",
       "L 884.269571 224.558778 \n",
       "L 887.648011 260.445169 \n",
       "L 891.139065 261.484918 \n",
       "L 894.63012 260.168654 \n",
       "L 898.008559 266.536332 \n",
       "L 901.499614 270.308606 \n",
       "L 908.369108 267.557451 \n",
       "L 911.860162 263.906184 \n",
       "L 915.125988 200.85489 \n",
       "L 918.617042 216.22388 \n",
       "L 921.995482 262.390699 \n",
       "L 925.486536 269.811022 \n",
       "L 928.864976 267.126679 \n",
       "L 932.35603 186.673446 \n",
       "L 935.847085 258.685376 \n",
       "L 939.225524 260.006675 \n",
       "L 942.716579 264.068903 \n",
       "L 946.095018 264.642326 \n",
       "L 949.586073 261.923674 \n",
       "L 953.077127 261.362405 \n",
       "L 956.230338 259.936597 \n",
       "L 959.721392 245.842794 \n",
       "L 963.099832 269.475363 \n",
       "L 966.590886 266.044375 \n",
       "L 969.969326 270.808846 \n",
       "L 973.46038 256.792463 \n",
       "L 980.329875 264.03277 \n",
       "L 983.820929 270.958725 \n",
       "L 987.199369 270.744227 \n",
       "L 990.690423 267.896474 \n",
       "L 994.181477 261.780075 \n",
       "L 997.334688 266.092455 \n",
       "L 1000.825742 220.887888 \n",
       "L 1004.204182 225.074259 \n",
       "L 1007.695236 259.828295 \n",
       "L 1011.073676 261.817603 \n",
       "L 1014.564731 265.350803 \n",
       "L 1018.055785 262.425358 \n",
       "L 1021.434225 262.354132 \n",
       "L 1024.925279 259.297751 \n",
       "L 1028.303719 254.071643 \n",
       "L 1031.794773 267.125469 \n",
       "L 1035.285828 272.225268 \n",
       "L 1038.439038 267.134922 \n",
       "L 1045.308532 267.959719 \n",
       "L 1048.799587 264.360905 \n",
       "L 1052.178026 268.498456 \n",
       "L 1055.669081 264.158772 \n",
       "L 1059.160135 263.870671 \n",
       "L 1062.538575 269.35326 \n",
       "L 1066.029629 267.824374 \n",
       "L 1069.408069 272.548876 \n",
       "L 1072.899123 268.311818 \n",
       "L 1076.390178 247.922221 \n",
       "L 1079.656003 249.241653 \n",
       "L 1083.147057 269.701273 \n",
       "L 1086.525497 263.90237 \n",
       "L 1090.016551 269.090662 \n",
       "L 1093.394991 271.349844 \n",
       "L 1096.886046 264.738811 \n",
       "L 1100.3771 270.82653 \n",
       "L 1103.75554 185.266389 \n",
       "L 1103.75554 185.266389 \n",
       "\" clip-path=\"url(#pb277b339e0)\" style=\"fill: none; stroke: #0000ff; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path d=\"M 38.482813 287.955758 \n",
       "L 38.482813 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path d=\"M 1154.482812 287.955758 \n",
       "L 1154.482812 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path d=\"M 38.482812 287.955758 \n",
       "L 1154.482812 287.955758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path d=\"M 38.482812 10.755758 \n",
       "L 1154.482812 10.755758 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_11\">\n",
       "     <path d=\"M 1027.034375 48.390133 \n",
       "L 1147.482813 48.390133 \n",
       "Q 1149.482813 48.390133 1149.482813 46.390133 \n",
       "L 1149.482813 17.755758 \n",
       "Q 1149.482813 15.755758 1147.482813 15.755758 \n",
       "L 1027.034375 15.755758 \n",
       "Q 1025.034375 15.755758 1025.034375 17.755758 \n",
       "L 1025.034375 46.390133 \n",
       "Q 1025.034375 48.390133 1027.034375 48.390133 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_43\">\n",
       "     <path d=\"M 1029.034375 23.854195 \n",
       "L 1039.034375 23.854195 \n",
       "L 1049.034375 23.854195 \n",
       "\" style=\"fill: none; stroke: #ff0000; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_41\">\n",
       "     <!-- Raw_return -->\n",
       "     <g transform=\"translate(1057.034375 27.354195) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-52\" d=\"M 2841 2188 \n",
       "Q 3044 2119 3236 1894 \n",
       "Q 3428 1669 3622 1275 \n",
       "L 4263 0 \n",
       "L 3584 0 \n",
       "L 2988 1197 \n",
       "Q 2756 1666 2539 1819 \n",
       "Q 2322 1972 1947 1972 \n",
       "L 1259 1972 \n",
       "L 1259 0 \n",
       "L 628 0 \n",
       "L 628 4666 \n",
       "L 2053 4666 \n",
       "Q 2853 4666 3247 4331 \n",
       "Q 3641 3997 3641 3322 \n",
       "Q 3641 2881 3436 2590 \n",
       "Q 3231 2300 2841 2188 \n",
       "z\n",
       "M 1259 4147 \n",
       "L 1259 2491 \n",
       "L 2053 2491 \n",
       "Q 2509 2491 2742 2702 \n",
       "Q 2975 2913 2975 3322 \n",
       "Q 2975 3731 2742 3939 \n",
       "Q 2509 4147 2053 4147 \n",
       "L 1259 4147 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-77\" d=\"M 269 3500 \n",
       "L 844 3500 \n",
       "L 1563 769 \n",
       "L 2278 3500 \n",
       "L 2956 3500 \n",
       "L 3675 769 \n",
       "L 4391 3500 \n",
       "L 4966 3500 \n",
       "L 4050 0 \n",
       "L 3372 0 \n",
       "L 2619 2869 \n",
       "L 1863 0 \n",
       "L 1184 0 \n",
       "L 269 3500 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \n",
       "L 3263 -1509 \n",
       "L -63 -1509 \n",
       "L -63 -1063 \n",
       "L 3263 -1063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-52\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"67.232422\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-77\" x=\"128.511719\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"210.298828\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"260.298828\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"299.162109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"360.685547\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"399.894531\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"463.273438\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"502.636719\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_44\">\n",
       "     <path d=\"M 1029.034375 38.810445 \n",
       "L 1039.034375 38.810445 \n",
       "L 1049.034375 38.810445 \n",
       "\" style=\"fill: none; stroke: #0000ff; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_42\">\n",
       "     <!-- Realized Volatility -->\n",
       "     <g transform=\"translate(1057.034375 42.310445) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-7a\" d=\"M 353 3500 \n",
       "L 3084 3500 \n",
       "L 3084 2975 \n",
       "L 922 459 \n",
       "L 3084 459 \n",
       "L 3084 0 \n",
       "L 275 0 \n",
       "L 275 525 \n",
       "L 2438 3041 \n",
       "L 353 3041 \n",
       "L 353 3500 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-64\" d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-56\" d=\"M 1831 0 \n",
       "L 50 4666 \n",
       "L 709 4666 \n",
       "L 2188 738 \n",
       "L 3669 4666 \n",
       "L 4325 4666 \n",
       "L 2547 0 \n",
       "L 1831 0 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-79\" d=\"M 2059 -325 \n",
       "Q 1816 -950 1584 -1140 \n",
       "Q 1353 -1331 966 -1331 \n",
       "L 506 -1331 \n",
       "L 506 -850 \n",
       "L 844 -850 \n",
       "Q 1081 -850 1212 -737 \n",
       "Q 1344 -625 1503 -206 \n",
       "L 1606 56 \n",
       "L 191 3500 \n",
       "L 800 3500 \n",
       "L 1894 763 \n",
       "L 2988 3500 \n",
       "L 3597 3500 \n",
       "L 2059 -325 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-52\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"64.982422\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"126.505859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"187.785156\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"215.568359\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-7a\" x=\"243.351562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"295.841797\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"357.365234\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-20\" x=\"420.841797\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-56\" x=\"452.628906\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"513.287109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"574.46875\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"602.251953\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"663.53125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"702.740234\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"730.523438\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"758.306641\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"786.089844\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-79\" x=\"825.298828\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pb277b339e0\">\n",
       "   <rect x=\"38.482813\" y=\"10.755758\" width=\"1116\" height=\"277.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 2000x500 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "reg_data_plot = reg_data['2000':].copy()\n",
    "\n",
    "fig, ax1 = plt.subplots(figsize=(20,5))\n",
    "ax1.plot(reg_data_plot['Raw_return'], \n",
    "         '-r',\n",
    "         label='Raw_return')\n",
    "\n",
    "data_format = mdates.DateFormatter('%Y')\n",
    "ax1.xaxis.set_major_formatter(data_format)\n",
    "ax1.xaxis.set_major_locator(mdates.YearLocator())\n",
    "plt.xticks(rotation=90)\n",
    "\n",
    "ax2 = ax1.twinx()\n",
    "ax2.plot(reg_data_plot['RV'], \n",
    "         '-b',\n",
    "         label='Realized Volatility')\n",
    "\n",
    "lines, labels = ax1.get_legend_handles_labels()\n",
    "lines2, labels2 = ax2.get_legend_handles_labels()\n",
    "ax2.legend(lines + lines2, labels + labels2, loc=0)\n",
    "\n",
    "plt.show();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 描述性统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "count    357.0000\n",
       "mean       0.0055\n",
       "std        0.0097\n",
       "min        0.0002\n",
       "25%        0.0015\n",
       "50%        0.0028\n",
       "75%        0.0060\n",
       "max        0.1484\n",
       "Name: RV, dtype: float64"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg_data['RV'].describe().round(4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.6994"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "133.477"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg_data['RV'].skew().round(4)#偏度\n",
    "reg_data['RV'].kurt().round(4)#峰度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# OLS回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:             Raw_return   R-squared:                       0.009\n",
      "Model:                            OLS   Adj. R-squared:                  0.006\n",
      "Method:                 Least Squares   F-statistic:                     2.703\n",
      "Date:                Thu, 14 Nov 2024   Prob (F-statistic):              0.101\n",
      "Time:                        22:38:05   Log-Likelihood:                 366.71\n",
      "No. Observations:                 297   AIC:                            -729.4\n",
      "Df Residuals:                     295   BIC:                            -722.0\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0113      0.005      2.093      0.037       0.001       0.022\n",
      "lRV           -1.3165      0.801     -1.644      0.101      -2.893       0.259\n",
      "==============================================================================\n",
      "Omnibus:                       13.540   Durbin-Watson:                   1.765\n",
      "Prob(Omnibus):                  0.001   Jarque-Bera (JB):               31.653\n",
      "Skew:                           0.066   Prob(JB):                     1.34e-07\n",
      "Kurtosis:                       4.594   Cond. No.                         195.\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "reg_data['lRV'] = reg_data['RV'].shift(1)\n",
    "reg_data['lcpi'] = reg_data['cpi'].shift(2)\n",
    "\n",
    "model = smf.ols('Raw_return ~ lRV', data = reg_data['2000':]).fit()\n",
    "print(model.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:             Raw_return   R-squared:                       0.040\n",
      "Model:                            OLS   Adj. R-squared:                  0.037\n",
      "Method:                 Least Squares   F-statistic:                     12.35\n",
      "Date:                Thu, 14 Nov 2024   Prob (F-statistic):           0.000511\n",
      "Time:                        22:38:05   Log-Likelihood:                 371.45\n",
      "No. Observations:                 297   AIC:                            -738.9\n",
      "Df Residuals:                     295   BIC:                            -731.5\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0204      0.006      3.490      0.001       0.009       0.032\n",
      "lcpi          -0.0073      0.002     -3.514      0.001      -0.011      -0.003\n",
      "==============================================================================\n",
      "Omnibus:                       14.674   Durbin-Watson:                   1.808\n",
      "Prob(Omnibus):                  0.001   Jarque-Bera (JB):               36.741\n",
      "Skew:                           0.050   Prob(JB):                     1.05e-08\n",
      "Kurtosis:                       4.720   Cond. No.                         4.35\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "model2 = smf.ols('Raw_return ~ lcpi', data = reg_data['2000':]).fit()\n",
    "print(model2.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:             Raw_return   R-squared:                       0.043\n",
      "Model:                            OLS   Adj. R-squared:                  0.036\n",
      "Method:                 Least Squares   F-statistic:                     6.540\n",
      "Date:                Thu, 14 Nov 2024   Prob (F-statistic):            0.00166\n",
      "Time:                        22:38:06   Log-Likelihood:                 371.82\n",
      "No. Observations:                 297   AIC:                            -737.6\n",
      "Df Residuals:                     294   BIC:                            -726.6\n",
      "Df Model:                           2                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0226      0.006      3.547      0.000       0.010       0.035\n",
      "lRV           -0.6994      0.812     -0.862      0.389      -2.297       0.898\n",
      "lcpi          -0.0069      0.002     -3.208      0.001      -0.011      -0.003\n",
      "==============================================================================\n",
      "Omnibus:                       14.182   Durbin-Watson:                   1.818\n",
      "Prob(Omnibus):                  0.001   Jarque-Bera (JB):               33.162\n",
      "Skew:                           0.106   Prob(JB):                     6.30e-08\n",
      "Kurtosis:                       4.623   Cond. No.                         583.\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "model = smf.ols('Raw_return ~ lRV + lcpi', data = reg_data['2000':]).fit()\n",
    "print(model.summary())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#  预测波动率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:                     RV   R-squared:                       0.368\n",
      "Model:                            OLS   Adj. R-squared:                  0.366\n",
      "Method:                 Least Squares   F-statistic:                     171.7\n",
      "Date:                Thu, 14 Nov 2024   Prob (F-statistic):           3.17e-31\n",
      "Time:                        22:38:06   Log-Likelihood:                 1212.6\n",
      "No. Observations:                 297   AIC:                            -2421.\n",
      "Df Residuals:                     295   BIC:                            -2414.\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0017      0.000      5.573      0.000       0.001       0.002\n",
      "lRV            0.6080      0.046     13.102      0.000       0.517       0.699\n",
      "==============================================================================\n",
      "Omnibus:                      120.927   Durbin-Watson:                   2.213\n",
      "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              477.096\n",
      "Skew:                           1.727   Prob(JB):                    2.51e-104\n",
      "Kurtosis:                       8.159   Cond. No.                         195.\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "model_fore_RV = smf.ols('RV ~ lRV', data = reg_data['2000':]).fit()\n",
    "print(model_fore_RV.summary())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Raw_return</th>\n",
       "      <th>cpi</th>\n",
       "      <th>RV</th>\n",
       "      <th>lRV</th>\n",
       "      <th>lcpi</th>\n",
       "      <th>RV_fore</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>month</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-31</th>\n",
       "      <td>0.123242</td>\n",
       "      <td>-0.2</td>\n",
       "      <td>0.008258</td>\n",
       "      <td>0.001771</td>\n",
       "      <td>-0.9</td>\n",
       "      <td>0.002814</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-29</th>\n",
       "      <td>0.116990</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0.013547</td>\n",
       "      <td>0.008258</td>\n",
       "      <td>-1.0</td>\n",
       "      <td>0.006759</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-03-31</th>\n",
       "      <td>0.049948</td>\n",
       "      <td>-0.2</td>\n",
       "      <td>0.007877</td>\n",
       "      <td>0.013547</td>\n",
       "      <td>-0.2</td>\n",
       "      <td>0.009974</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-04-30</th>\n",
       "      <td>0.020053</td>\n",
       "      <td>-0.3</td>\n",
       "      <td>0.002494</td>\n",
       "      <td>0.007877</td>\n",
       "      <td>0.7</td>\n",
       "      <td>0.006527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-05-31</th>\n",
       "      <td>0.031710</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0.003515</td>\n",
       "      <td>0.002494</td>\n",
       "      <td>-0.2</td>\n",
       "      <td>0.003254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-05-31</th>\n",
       "      <td>-0.005801</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.000915</td>\n",
       "      <td>0.001542</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0.002675</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-06-30</th>\n",
       "      <td>-0.038684</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.000642</td>\n",
       "      <td>0.000915</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.002294</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>-0.009656</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.001441</td>\n",
       "      <td>0.000642</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.002128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-08-31</th>\n",
       "      <td>-0.032849</td>\n",
       "      <td>0.6</td>\n",
       "      <td>0.000705</td>\n",
       "      <td>0.001441</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.002614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-09-30</th>\n",
       "      <td>0.173908</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.011045</td>\n",
       "      <td>0.000705</td>\n",
       "      <td>0.5</td>\n",
       "      <td>0.002167</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>297 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Raw_return  cpi        RV       lRV  lcpi   RV_fore\n",
       "month                                                          \n",
       "2000-01-31    0.123242 -0.2  0.008258  0.001771  -0.9  0.002814\n",
       "2000-02-29    0.116990  0.7  0.013547  0.008258  -1.0  0.006759\n",
       "2000-03-31    0.049948 -0.2  0.007877  0.013547  -0.2  0.009974\n",
       "2000-04-30    0.020053 -0.3  0.002494  0.007877   0.7  0.006527\n",
       "2000-05-31    0.031710  0.1  0.003515  0.002494  -0.2  0.003254\n",
       "...                ...  ...       ...       ...   ...       ...\n",
       "2024-05-31   -0.005801  0.3  0.000915  0.001542   0.1  0.002675\n",
       "2024-06-30   -0.038684  0.2  0.000642  0.000915   0.3  0.002294\n",
       "2024-07-31   -0.009656  0.5  0.001441  0.000642   0.3  0.002128\n",
       "2024-08-31   -0.032849  0.6  0.000705  0.001441   0.2  0.002614\n",
       "2024-09-30    0.173908  0.4  0.011045  0.000705   0.5  0.002167\n",
       "\n",
       "[297 rows x 6 columns]"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg_data_new = reg_data['2000':].copy()\n",
    "reg_data_new['RV_fore'] = model_fore_RV.fittedvalues\n",
    "reg_data_new"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            OLS Regression Results                            \n",
      "==============================================================================\n",
      "Dep. Variable:             Raw_return   R-squared:                       0.009\n",
      "Model:                            OLS   Adj. R-squared:                  0.006\n",
      "Method:                 Least Squares   F-statistic:                     2.703\n",
      "Date:                Thu, 14 Nov 2024   Prob (F-statistic):              0.101\n",
      "Time:                        22:38:06   Log-Likelihood:                 366.71\n",
      "No. Observations:                 297   AIC:                            -729.4\n",
      "Df Residuals:                     295   BIC:                            -722.0\n",
      "Df Model:                           1                                         \n",
      "Covariance Type:            nonrobust                                         \n",
      "==============================================================================\n",
      "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
      "------------------------------------------------------------------------------\n",
      "Intercept      0.0150      0.007      2.122      0.035       0.001       0.029\n",
      "RV_fore       -2.1654      1.317     -1.644      0.101      -4.758       0.427\n",
      "==============================================================================\n",
      "Omnibus:                       13.540   Durbin-Watson:                   1.765\n",
      "Prob(Omnibus):                  0.001   Jarque-Bera (JB):               31.653\n",
      "Skew:                           0.066   Prob(JB):                     1.34e-07\n",
      "Kurtosis:                       4.594   Cond. No.                         321.\n",
      "==============================================================================\n",
      "\n",
      "Notes:\n",
      "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n"
     ]
    }
   ],
   "source": [
    "model_fore_ret = smf.ols('Raw_return ~ RV_fore', data = reg_data_new).fit()\n",
    "print(model_fore_ret.summary())"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
